/*
*/

#include "./psorunner.h"

PsoRunner::PsoRunner(QObject* parent) : QThread( parent )
{
   connect( &m_pso, SIGNAL(iterationCompleted(int)), this, SIGNAL(iterationCompleted(int)) );
   connect( &m_pso, SIGNAL(sampleCompleted(int)), this, SIGNAL(sampleCompleted(int)) );
   connect( &m_pso, SIGNAL(newBestFitnessFound(double)), this, SIGNAL(newBestFitnessFound(double)) );
}

PsoRunner::PsoRunner(Pso pso, QObject *parent) : QThread( parent ), m_pso( pso )
{
   connect( &m_pso, SIGNAL(iterationCompleted(int)), this, SIGNAL(iterationCompleted(int)) );
   connect( &m_pso, SIGNAL(sampleCompleted(int)), this, SIGNAL(sampleCompleted(int)) );
   connect( &m_pso, SIGNAL(newBestFitnessFound(double)), this, SIGNAL(newBestFitnessFound(double)) );
}

void PsoRunner::setPso(Pso pso)
{
   m_pso = pso;
}

Pso PsoRunner::pso()
{
   return m_pso;
}


void PsoRunner::stopOptimizing()
{
   m_pso.stopOptimizing();
}


void PsoRunner::run()
{
   m_pso.optimize();
}
